from rest_framework import serializers
from app01 import models

# 车模型序列化
class CarModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.CarModel
        fields = ['model_name','model_price','carfactory','factory_name','distributor_name_phone']
        extra_kwargs = {
                    'factory_name':{'read_only':True},
                    'distributor_name_phone':{'read_only':True},
                }